    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <script type="text/javascript">
        window.addEventListener("load",eventWindowLoaded,false);
        function eventWindowLoaded(){
            canvasApp();
        }
        function canvasApp(){
            // draw black square
            var theCanvas=document.getElementById("canvas");
            var context=theCanvas.getContext("2d");
            // now draw a red square
            context.setTransform(1,0,0,1,1,1);
            var angleInRadians=45 * (Math.PI/180);
            context.rotate(angleInRadians)
            context.fillstyle="red";
            context.fillRect(100,100,50,50);
        }
        </script>
        <title>Document</title>
    </head>
    <body>
        <div style="position:absolute;top:50px;left:50px">
            <canvas id="canvas" height="500" width="500">Your browser does not support HTML5 Canvas.</canvas>
        </div>
    </body>
    </html>